/*
 * @Author: your name
 * @Date: 2021-07-14 14:24:31
 * @LastEditTime: 2021-07-14 17:59:17
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue-hr-project\src\store\modules\menus.js
 */

import { constantRoutes } from '@/router'
export default {
  namespaced: true, // 开启命名空间
  // 放置响应式数据
  state: {
    // 存放所有可以显示到左侧的菜单区域的数据list  静态路由表作为默认值
    menuList: [...constantRoutes]
  },
  // 放置修改响应式数据的方法
  mutations: {
    setMenyList(state, asycRoutes) {
      state.menuList = [...state.menuList, ...asycRoutes]
    },
    clearMenuList(state) {
      state.menuList = [...constantRoutes]
    }
  },
  // 异步操作 + 提交 mutations函数
  actions: {

  }
}

